// 路由文件夹
// 静态路由 动态权限路由

import Vue from 'vue'
import Router from 'vue-router'
Vue.use(Router)

import login from "@/view/login/login";
import home from "@/view/home/home";


let RouterMain = new Router({
  mode:"hash",
  routes: [
    {
      path:"/",
      name:"login",
      component:login,
      meta:{
        title:"登录页"
      }
    },
  ]
})


RouterMain.beforeEach((to , from , next)=>{
  console.log(to)
  console.log(from)
  next()
})

RouterMain.afterEach((to,from)=>{
  console.log(to)
  console.log(from)
  document.title = to.meta.title;

})
export default RouterMain